package com.hqyj.fj.java_spring_cloud_test.controller;

import com.hqyj.fj.entity.test.Country;
import com.hqyj.fj.java_spring_cloud_test.service.CountryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/*
 * @Description CountryController
 * @Author HymanHu
 * @Date 2021/8/19 15:27
 */
@RestController
@RequestMapping("/api/test/")
public class CountryController {

    @Autowired
    private CountryService countryService;

    /*
     * 127.0.0.1/api/country/522 ---- get
     */
    @GetMapping("/country/{countryId}")
    public Country getCountryByCountryId(@PathVariable int countryId) {
        return countryService.getCountryByCountryId(countryId);
    }
}
